package com.ruoyi.project.video.chatmessages.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.video.chatmessages.mapper.ChatmessagesMapper;
import com.ruoyi.project.video.chatmessages.domain.Chatmessages;
import com.ruoyi.project.video.chatmessages.service.IChatmessagesService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 聊天内容Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-25
 */
@Service
public class ChatmessagesServiceImpl implements IChatmessagesService 
{
    @Autowired
    private ChatmessagesMapper chatmessagesMapper;

    /**
     * 查询聊天内容
     * 
     * @param MessageID 聊天内容主键
     * @return 聊天内容
     */
    @Override
    public Chatmessages selectChatmessagesByMessageID(Long MessageID)
    {
        return chatmessagesMapper.selectChatmessagesByMessageID(MessageID);
    }

    /**
     * 查询聊天内容列表
     * 
     * @param chatmessages 聊天内容
     * @return 聊天内容
     */
    @Override
    public List<Chatmessages> selectChatmessagesList(Chatmessages chatmessages)
    {
        return chatmessagesMapper.selectChatmessagesList(chatmessages);
    }

    /**
     * 新增聊天内容
     * 
     * @param chatmessages 聊天内容
     * @return 结果
     */
    @Override
    public int insertChatmessages(Chatmessages chatmessages)
    {
        return chatmessagesMapper.insertChatmessages(chatmessages);
    }

    /**
     * 修改聊天内容
     * 
     * @param chatmessages 聊天内容
     * @return 结果
     */
    @Override
    public int updateChatmessages(Chatmessages chatmessages)
    {
        return chatmessagesMapper.updateChatmessages(chatmessages);
    }

    /**
     * 批量删除聊天内容
     * 
     * @param MessageIDs 需要删除的聊天内容主键
     * @return 结果
     */
    @Override
    public int deleteChatmessagesByMessageIDs(String MessageIDs)
    {
        return chatmessagesMapper.deleteChatmessagesByMessageIDs(Convert.toStrArray(MessageIDs));
    }

    /**
     * 删除聊天内容信息
     * 
     * @param MessageID 聊天内容主键
     * @return 结果
     */
    @Override
    public int deleteChatmessagesByMessageID(Long MessageID)
    {
        return chatmessagesMapper.deleteChatmessagesByMessageID(MessageID);
    }
}
